{extend name="public/base"}

{block name="title"}就行天下-提现{/block}

{block name="style"}
<link rel="stylesheet" href="__STATIC__/home/css/business.css" />
<style>
    .weui-cell.recharge_name:before {
        left: -2%;
        right: -2%;
    }
    .recharge_name_btn.weui-cell:before {
        left: 15px;
        right: -2%;
    }
    .recharge_name_btn.weui-cell {
        padding: .8rem 15px;
    }
    .recharge{
        margin: .8rem auto 0;
    }
</style>
{/block}

{block name="main"}
<div class="pageControl bg-f5">
    <div class="main-top"></div>
    <div class="msui_nav msui_navTop">
        <a class="msui_navTop-back" href="javascript:history.back();"><i class="micon-back"></i></a>
        <h1 class="msui_navTop-title">提现</h1>
        <a href="" class="msui_navTop-right msui_navTop-cnav"><i class="micon-cnav"></i></a>
    </div>
    <div class="recharge bg-fff">
        <a href="javascript:;" class="weui-cell bank" style="padding: 0 0 10px 0">
            <div class="weui-cell__hd img_11">
                <img src="__STATIC__/home/images/zs.png" alt="">
            </div>
            <div class="weui-cell__bd">
                <div>
                    中国工商银行（<span>5423</span>）
                </div>
            </div>
        </a>
        <div class="weui-cell recharge_name p00">
            <div class="weui-cell__hd" style="margin-left: 1rem">
                <span class="fs15">￥</span>
            </div>
            <div class="weui-cell__bd">
                <input type="text" class="weui-input">
            </div>
            <div class="weui-cell__ft">
                <p class="cl-9999">可用余额<span class="cl-3333 withdraw-money">{$data.money}</span>元</p>
                <a href="" class="cl-219 withdraw">全部提现</a>
            </div>
        </div>
        <div class="weui-cell recharge_name_btn">
            <button class="login-btn cl-f withdraw-btn" disabled="disabled">下一步</button>
        </div>
    </div>
</div>
<!--没有银行卡-->
<div id="noPassword" class="centerPopup weui-popup__container">
    <div class="weui-popup__overlay"></div>
    <div class="weui-popup__modal">
        <div class="fs065 title">
            您还没有添加的银行卡, 是否添加?
        </div>
        <div class="model-btn-two">
            <a href="" class="close-popup">取消</a>
            <a href="" class="cl-c40">立即添加</a>
        </div>
    </div>
</div>
<div id="bank_list" class="weui-popup__container">
    <div class="weui-popup__overlay"></div>
    <div class="weui-popup__modal">
        <div class="toolbar">
            <div class="toolbar-inner">
                <h1 class="title cl-3333 fs075">银行卡</h1>
                <a href="javascript:;" class="cl-666 picker-button close close-popup">
                    <i class="icon iconfont icon-guanbi1"></i>
                </a>
            </div>
        </div>
        <div class="modal-content fs06 bg-fff" style="padding-bottom: 1rem" >
            <div class="weui-cells_checkbox js-choose">
                <label class="weui-cell weui-check__label">
                    <div class="weui-cell__bd">
                        <div class="msui_table">
                            <div class="msui_tabCell-img">
                                <img src="__STATIC__/home/images/pay.png">
                            </div>
                            <div class="msui_tabCell-content">
                                <p class="fs07 cl-3333">中国工商银行储蓄卡(5423)</p>
                                <p class="fs07 cl-9999">可用额度1000.00</p>
                            </div>
                        </div>
                    </div>
                </label>
            </div>
            <div class="weui-cells">
                <div class="weui-cell weui-cell_access">
                    <div class="weui-cell__bd">
                        <div class="msui_table img_11">
                            <div class="msui_tabCell-img">
                                <img src="__STATIC__/home/images/addA.png">
                            </div>
                            <div class="msui_tabCell-content">
                                <p class="fs07 cl-3333">添加银行卡</p>
                            </div>
                        </div>
                    </div>
                    <div class="weui-cell__ft">

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--没有支付密码-->
{include file="public/noPassword" /}
<!--有支付密码-->
{include file="public/paymentPassword" /}
<!--提现成功-->
<div id="paySucc" class="centerPopup weui-popup__container">
    <div class="weui-popup__overlay"></div>
    <div class="weui-popup__modal">
        <div class="fs065 title">
            预计2小时内到账, 请注意查收
        </div>
        <div class="model-btn-two">
            <a href="" class="close-popup">知道了</a>
        </div>
    </div>
</div>
{/block}

{block name="javascript"}
<script src="__STATIC__/home/js/payment.js"></script>
<script>
    $(function () {
        $(".bank").click(function () {
            $('#bank_list').popup();
        });

        $(".recharge").on('keyup','input',function () {
            if($('.recharge .weui-input').val()!=''){
                $('.login-btn').removeAttr('disabled');
            }else{
                $('.login-btn').attr('disabled','disabled');
            }
        });
        $('.withdraw').click(function (e) {
            e.preventDefault();
            var price=$('.withdraw-money').html();
            var reg = new RegExp(",");
            price = price.replace(reg,"");
            price = price.split('.')[0];
            $('.recharge .weui-input').val(price);
            $('.login-btn').removeAttr('disabled');
        });

        // 点击确认提现
        $(".withdraw-btn").click(function () {
            // 检查提现金额是
            var price = $('.recharge .weui-input').val();
            price = price.replace(reg,"");
            price = price.split('.')[0];
            if (price < 100) {
                $.toptip('最低提现金额为100元');
                return false;
            }

            SCOPE.withraw_data = {
                price : price
            };
            check_is_set_safe_password();
        });
    });
</script>
{/block}